<template>
    <div class="markModel">
        <el-row :gutter="24">
            <el-col :span="22">
                <el-form :inline="true" class="demo-form-inline">
                    <el-form-item label="公开（公告）号">


                        <el-input v-model="formInline.gk_gg_h" placeholder="搜索"></el-input>
                    </el-form-item>
                    <el-form-item label="专利名称">

                        <el-input v-model="formInline.bt_zw_" placeholder="搜索"></el-input>
                    </el-form-item>
                    <el-form-item label="发明人">

                        <el-input v-model="formInline.famingren" placeholder="搜索"></el-input>
                    </el-form-item>
                    <el-form-item label="分级">
                        <el-select v-model="formInline.fenjiValue" clearable placeholder="请选择">
                            <el-option v-for="item in options" :key="item.value" :label="item.label"
                                :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item>
                        <el-button @click="resetForm()">重置</el-button>
                        <el-button type="primary" @click="onSubmit">查询</el-button>
                    </el-form-item>
                    <el-form-item>

                        <el-button type="primary" @click="addModel()">新增</el-button>
                    </el-form-item>
                </el-form>
            </el-col>
        </el-row>
        <el-row :gutter="24">
            <el-col :span="24">
                <el-table :data="tableData" border style="width: 100%" align="center"
                    :default-sort="{ prop: 'fenji', order: 'descending' }">
                    <el-table-column type="index" width="50" center>
                    </el-table-column>
                    <el-table-column prop="gk_gg_h" label="公开（公告）号" width="180">
                    </el-table-column>
                    <el-table-column prop="bt_zw_" label="专利名称">
                    </el-table-column>

                    <el-table-column prop="shenqingri" label="申请日" width="180">
                    </el-table-column>
                    <!-- <el-table-column prop="zhaiyao" label="摘要" :show-overflow-tooltip="true">
                    </el-table-column> -->
                    <el-table-column prop="famingren" label="发明人" width="180">
                    </el-table-column>
                    <el-table-column prop="zlyxx" label="专利有效性" width="180">
                    </el-table-column>

                    <el-table-column prop="fenji" label="分级" width="120" sortable>
                    </el-table-column>
                    <el-table-column fixed="right" label="操作" width="180">
                        <template slot-scope="scope">
                            <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
                            <el-button @click="editClick(scope.row)" type="text" size="small">编辑</el-button>
                            <el-button @click="deleteRow(scope.row)" type="text" size="small"
                                slot="reference">删除</el-button>

                        </template>
                    </el-table-column>
                </el-table>
            </el-col>
        </el-row>
        <div style="text-align: right; margin-top: 20px;">

            <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
                :current-page="currentPage" :page-sizes="[10, 20, 30, 40, 50, 100]" :page-size="pageSize"
                layout="total, prev, pager, next, sizes" :total="total">
            </el-pagination>
        </div>
        <el-dialog title="新增" :visible.sync="dialogFormVisible">
            <el-form :model="form" ref="form" label-position="top">
                <el-row :gutter="24">
                    <el-col :span="24">

                        <el-form-item label="请在输入公开（公告）号之后，在输入框中按键盘上的Enter（回车）">
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row :gutter="24">
                    <el-col :span="12">
                        <el-form-item label="专利名称" :label-width="formLabelWidth">
                            <el-input v-model="form.bt_zw_" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="公开（公告）号" :label-width="formLabelWidth">
                            <el-input v-model="form.gk_gg_h" autocomplete="off" @change="inputChange"></el-input>
                        </el-form-item>

                    </el-col>
                </el-row>
                <el-row :gutter="24">
                    <el-col :span="24">
                        <el-form-item label="分级" :label-width="formLabelWidth">
                            <el-input v-model="form.fenji" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>
                    </el-col>

                </el-row>

                <el-row :gutter="24">
                    <el-col :span="8">
                        <el-form-item label="专利有效性" :label-width="formLabelWidth">
                            <el-input v-model="form.zlyxx" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="申请日" :label-width="formLabelWidth">
                            <el-input v-model="form.shenqingri" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>

                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="发明人" :label-width="formLabelWidth">
                            <el-input v-model="form.famingren" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>
                    </el-col>

                </el-row>

                <el-row :gutter="24">
                    <el-col :span="12">
                        <el-form-item label="无效情况" :label-width="formLabelWidth">
                            <el-input v-model="form.wxqk" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="侵权情况" :label-width="formLabelWidth">
                            <el-input v-model="form.qqqk" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>

                    </el-col>
                </el-row>

                <el-row :gutter="24">
                    <el-col :span="12">
                        <el-form-item label="简单同族个数" :label-width="formLabelWidth">
                            <el-input v-model="form.jdtzgs" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="扩展同族个数" :label-width="formLabelWidth">
                            <el-input v-model="form.kztzgs" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>

                    </el-col>
                </el-row>

                <el-row :gutter="24">
                    <el-col :span="8">
                        <el-form-item label="许可情况" :label-width="formLabelWidth">
                            <el-input v-model="form.xkqk" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="海关备案" :label-width="formLabelWidth">
                            <el-input v-model="form.hgba" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>

                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="转让情况" :label-width="formLabelWidth">
                            <el-input v-model="form.zrqk" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>
                    </el-col>

                </el-row>

                <el-row :gutter="24">
                    <el-col :span="24">
                        <el-form-item label="同族国家/地区" :label-width="formLabelWidth">
                            <el-input v-model="form.tzgj_dq" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>
                    </el-col>

                </el-row>

                <el-row :gutter="24">
                    <el-col :span="8">
                        <el-form-item label="权利要求数量" :label-width="formLabelWidth">
                            <el-input v-model="form.qlyqsl" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="独立权利要求数量" :label-width="formLabelWidth">
                            <el-input v-model="form.dlqlyqsl" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>

                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="从属权利要求数量" :label-width="formLabelWidth">
                            <el-input v-model="form.csqlyqsl" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>
                    </el-col>

                </el-row>

                <el-row :gutter="24">
                    <el-col :span="12">
                        <el-form-item label="获奖情况" :label-width="formLabelWidth">
                            <el-input v-model="form.hjqk" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="标准专利" :label-width="formLabelWidth">
                            <el-input v-model="form.bzzl" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>

                    </el-col>
                </el-row>

                <el-row :gutter="24">
                    <el-col :span="24">
                        <el-form-item label="摘要" :label-width="formLabelWidth">
                            <el-input type="textarea" v-model="form.zhaiyao" autosize :disabled="true"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row :gutter="24">
                    <el-col :span="24">
                        <el-form-item label="所属单位" :label-width="formLabelWidth">
                            <el-input v-model="form.ssdw" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>
                    </el-col>

                </el-row>
                <el-row :gutter="24">
                    <el-col :span="24">
                        <el-form-item label="最终分级" :label-width="formLabelWidth">
                            <el-input v-model="form.zzfj" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>
                    </el-col>

                </el-row>



            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="dialogFormVisible = false">取 消</el-button>
                <el-button type="primary" @click="addRow">提交</el-button>
            </div>
        </el-dialog>

        <!-- 查看 -->
        <el-dialog :span="24" :visible.sync="rowVisible" width="70%">
            <el-descriptions class="margin-top" :title="rowItem.bt_zw_" :column="2">
                <el-descriptions-item label="专利名称">&nbsp;&nbsp;{{ rowItem.bt_zw_ }}</el-descriptions-item>
                <el-descriptions-item label="公开（公告）号"> &nbsp;&nbsp; {{ rowItem.gk_gg_h }}</el-descriptions-item>
                <el-descriptions-item label="分级" :span="24">&nbsp;&nbsp;{{ rowItem.fenji }}</el-descriptions-item>

                <el-descriptions-item label="专利有效性" :span="8">&nbsp;&nbsp;{{ rowItem.zlyxx }}</el-descriptions-item>
                <el-descriptions-item label="申请日" :span="8">&nbsp;&nbsp;{{ rowItem.shenqingri }}</el-descriptions-item>
                <el-descriptions-item label="发明人" :span="8">&nbsp;&nbsp;{{ rowItem.famingren }}</el-descriptions-item>

                <el-descriptions-item label="无效情况">&nbsp;&nbsp;{{ rowItem.wxqk }}</el-descriptions-item>
                <el-descriptions-item label="侵权情况">&nbsp;&nbsp;{{ rowItem.qqqk }}</el-descriptions-item>

                <el-descriptions-item label="简单同族个数">&nbsp;&nbsp;{{ rowItem.jdtzgs }}</el-descriptions-item>
                <el-descriptions-item label="扩展同族个数">&nbsp;&nbsp;{{ rowItem.kztzgs }}</el-descriptions-item>

                <el-descriptions-item label="许可情况">&nbsp;&nbsp;{{ rowItem.xkqk }}</el-descriptions-item>
                <el-descriptions-item label="海关备案">&nbsp;&nbsp;{{ rowItem.hgba }}</el-descriptions-item>
                <el-descriptions-item label="转让情况">&nbsp;&nbsp;{{ rowItem.zrqk }}</el-descriptions-item>

                <el-descriptions-item label="同族国家/地区" :span="24">&nbsp;&nbsp;{{ rowItem.tzgj_dq
                    }}</el-descriptions-item>

                <el-descriptions-item label="权利要求数量" :span="8">&nbsp;&nbsp;{{ rowItem.qlyqsl }}</el-descriptions-item>
                <el-descriptions-item label="独立权利要求数量" :span="8">&nbsp;&nbsp;{{ rowItem.dlqlyqsl
                    }}</el-descriptions-item>
                <el-descriptions-item label="从属权利要求数量" :span="8">&nbsp;&nbsp;{{ rowItem.csqlyqsl
                    }}</el-descriptions-item>


                <el-descriptions-item label="获奖情况">&nbsp;&nbsp;{{ rowItem.hjqk }}</el-descriptions-item>
                <el-descriptions-item label="标准专利">&nbsp;&nbsp;{{ rowItem.bzzl }}</el-descriptions-item>

                <el-descriptions-item label="摘要" :span="24">&nbsp;&nbsp;{{ rowItem.zhaiyao }}</el-descriptions-item>

                <el-descriptions-item label="所属单位" :span="24">&nbsp;&nbsp;{{ rowItem.ssdw }}</el-descriptions-item>

                <!--                <el-descriptions-item label="最终分级" :span="24">&nbsp;&nbsp;{{ rowItem.zzfj }}</el-descriptions-item>-->
            </el-descriptions>

        </el-dialog>

        <!-- 编辑 -->
        <el-dialog title="编辑" :visible.sync="dialogEditVisible">
            <el-form :model="editFrom" ref="editFrom" label-position="top">

                <el-row :gutter="24">
                    <el-col :span="12">
                        <el-form-item label="专利名称" :label-width="formLabelWidth">
                            <el-input v-model="editFrom.bt_zw_" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="公开（公告）号" :label-width="formLabelWidth">
                            <el-input v-model="editFrom.gk_gg_h" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>

                    </el-col>
                </el-row>
                <el-row :gutter="24">
                    <el-col :span="24">
                        <el-form-item label="分级" :label-width="formLabelWidth">
                            <el-select v-model="editFrom.fenji" clearable placeholder="请选择">
                                <el-option v-for="item in options" :key="item.value" :label="item.label"
                                    :value="item.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>

                </el-row>

                <el-row :gutter="24">
                    <el-col :span="8">
                        <el-form-item label="专利有效性" :label-width="formLabelWidth">
                            <el-input v-model="editFrom.zlyxx" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="申请日" :label-width="formLabelWidth">
                            <el-input v-model="editFrom.shenqingri" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>

                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="发明人" :label-width="formLabelWidth">
                            <el-input v-model="editFrom.famingren" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>
                    </el-col>

                </el-row>

                <el-row :gutter="24">
                    <el-col :span="12">
                        <el-form-item label="无效情况" :label-width="formLabelWidth">
                            <el-input v-model="editFrom.wxqk" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="侵权情况" :label-width="formLabelWidth">
                            <el-input v-model="editFrom.qqqk" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>

                    </el-col>
                </el-row>

                <el-row :gutter="24">
                    <el-col :span="12">
                        <el-form-item label="简单同族个数" :label-width="formLabelWidth">
                            <el-input v-model="editFrom.jdtzgs" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="扩展同族个数" :label-width="formLabelWidth">
                            <el-input v-model="editFrom.kztzgs" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>

                    </el-col>
                </el-row>

                <el-row :gutter="24">
                    <el-col :span="8">
                        <el-form-item label="许可情况" :label-width="formLabelWidth">
                            <el-input v-model="editFrom.xkqk" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="海关备案" :label-width="formLabelWidth">
                            <el-input v-model="editFrom.hgba" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>

                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="转让情况" :label-width="formLabelWidth">
                            <el-input v-model="editFrom.zrqk" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>
                    </el-col>

                </el-row>

                <el-row :gutter="24">
                    <el-col :span="24">
                        <el-form-item label="同族国家/地区" :label-width="formLabelWidth">
                            <el-input v-model="editFrom.tzgj_dq" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>
                    </el-col>

                </el-row>

                <el-row :gutter="24">
                    <el-col :span="8">
                        <el-form-item label="权利要求数量" :label-width="formLabelWidth">
                            <el-input v-model="editFrom.qlyqsl" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="独立权利要求数量" :label-width="formLabelWidth">
                            <el-input v-model="editFrom.dlqlyqsl" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>

                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="从属权利要求数量" :label-width="formLabelWidth">
                            <el-input v-model="editFrom.csqlyqsl" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>
                    </el-col>

                </el-row>

                <el-row :gutter="24">
                    <el-col :span="12">
                        <el-form-item label="获奖情况" :label-width="formLabelWidth">
                            <el-input v-model="editFrom.hjqk" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="标准专利" :label-width="formLabelWidth">
                            <el-input v-model="editFrom.bzzl" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>

                    </el-col>
                </el-row>

                <el-row :gutter="24">
                    <el-col :span="24">
                        <el-form-item label="摘要" :label-width="formLabelWidth">
                            <el-input type="textarea" v-model="editFrom.zhaiyao" autosize :disabled="true"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row :gutter="24">
                    <el-col :span="24">
                        <el-form-item label="所属单位" :label-width="formLabelWidth">
                            <el-input v-model="editFrom.ssdw" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>
                    </el-col>

                </el-row>
                <el-row :gutter="24">
                    <el-col :span="24">
                        <el-form-item label="最终分级" :label-width="formLabelWidth">
                            <el-input v-model="editFrom.zzfj" autocomplete="off" :disabled="true"></el-input>
                        </el-form-item>
                    </el-col>

                </el-row>



            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="dialogEditVisible = false">取 消</el-button>
                <el-button type="primary" @click="editRow">提交</el-button>
            </div>
        </el-dialog>

    </div>
</template>
<script>
import Cookies from "js-cookie";
export default {
    data() {
        return {
            userInfo: {},
            tableData: [],
            currentPage: 1,
            pageSize: 50,
            total: 0,
            dialogFormVisible: false,

            form: {
                gk_gg_h: '',
                zlyxx: '',
                shenqingri: '',
                zhaiyao: '',
                fenji: '',
                bt_zw_: '',
                famingren: '',
                jdtzgs: '',
                kztzgs: '',
                tzgj_dq: '',
                qlyqsl: '',
                dlqlyqsl: '',
                csqlyqsl: '',
                ssdw: '',
                zzfj: '',
                zlybk: '',


                bzzl: '',
                hgba: '',
                hjqk: '',
                qqqk: '',
                wxqk: '',
                xkqk: '',
                zrqk: '',
                fenzhi: ''

            },
            dialogEditVisible: false,
            editFrom: {
                
            },
            formLabelWidth: '100px',
            ssdw: '',
            rowsItem: {},
            formInline: {
                bt_zw_: '',
                gk_gg_h: '',
                famingren: '',
                fenjiValue: ''
            },
            visible: false,
            rowItem: {},
            rowVisible: false,

            options: [{
                value: 'A',
                label: 'A'
            }, {
                value: 'B',
                label: 'B'
            }, {
                value: 'C',
                label: 'C'
            }, {
                value: 'D',
                label: 'D'
            },],

        }
    },
    created() {

    },
    mounted() {
        this.getCookie();
        this.getFilterRows();
    },
    methods: {
        getCookie() {
            this.userInfo = JSON.parse(Cookies.get("userInfo"));
        },
        //新增
        addModel(formName) {
            this.form.gk_gg_h = ''
            this.form.zlyxx = ''
            this.form.shenqingri = ''
            this.form.zhaiyao = ''
            this.form.bt_zw_ = ''
            this.form.fenji = ''
            this.dialogFormVisible = true
            console.log(this.form)
        },

        //输入公开（公告）号
        inputChange() {
            console.log(this.form.gk_gg_h)
            var param = {
                "appKey": "c4d42996f1b29c98",
                "sign": "MGJjY2VmMGQwYjIzYzM3OTBjYmYyODk0ODJjOGQ0ZmY1Y2MzZTRlZDNkMmIyYzM1NTRjZDMxYTIwMzg3ODIzMw==",
                "worksheetId": "64f697fbe13132adf644a4f9",
                "viewId": "",
                "pageSize": this.pageSize,
                "pageIndex": this.currentPage,
                "sortId": "",
                "isAsc": "true",
                "filters": [
                    {
                        "controlId": "gk_gg_h",
                        "dataType": 2,
                        "spliceType": 1,
                        "filterType": 1,
                        "value": this.form.gk_gg_h
                    },

                ]
            }
            this.$apiFun.getFilterRows(param).then((res) => {
                //根据后端返回数据进行data的逻辑处理
                console.log(res)

                // this.total = res.data.total
                // this.tableData = res.data.rows
                if (res.data.rows.length > 0) {
                    var rows = res.data.rows[0]
                    this.form.zlyxx = rows.zlyxx
                    this.form.shenqingri = rows.shenqingri
                    this.form.zhaiyao = rows.zy_zw_
                    this.form.bt_zw_ = rows.bt_zw_
                    this.form.famingren = rows.famingren
                    this.form.jdtzgs = rows.jdtzgs
                    this.form.kztzgs = rows.kztzgs
                    this.form.tzgj_dq = rows.tzgj_dq
                    this.form.qlyqsl = rows.qlyqsl
                    this.form.dlqlyqsl = rows.dlqlyqsl
                    this.form.csqlyqsl = rows.csqlyqsl
                    this.form.ssdw = this.userInfo.danwei
                    this.form.zzfj = rows.zzfj
                    this.form.zlybk = rows.rowid

                    // item = res.data.rows[0]
                    this.predict(res.data.rows[0])
                }


            })
        },

        //获取列表
        getFilterRows() {
            var param = {
                "appKey": "c4d42996f1b29c98",
                "sign": "MGJjY2VmMGQwYjIzYzM3OTBjYmYyODk0ODJjOGQ0ZmY1Y2MzZTRlZDNkMmIyYzM1NTRjZDMxYTIwMzg3ODIzMw==",
                "worksheetId": "64dc89d71777cd57b6e251de",
                "viewId": "",
                "pageSize": this.pageSize,
                "pageIndex": this.currentPage,
                "sortId": "",
                "isAsc": "true",
                "filters": [

                    {
                        "controlId": "ssdw",
                        "dataType": 2,
                        "spliceType": 1,
                        "filterType": 1,
                        "value": this.userInfo.danwei
                    },
                    {
                        "controlId": "bt_zw_",
                        "dataType": 2,
                        "spliceType": 1,
                        "filterType": 1,
                        "value": this.formInline.bt_zw_
                    },
                    {
                        "controlId": "gk_gg_h",
                        "dataType": 2,
                        "spliceType": 1,
                        "filterType": 1,
                        "value": this.formInline.gk_gg_h
                    },
                    {
                        "controlId": "famingren",
                        "dataType": 2,
                        "spliceType": 1,
                        "filterType": 1,
                        "value": this.formInline.famingren
                    },
                    {
                        "controlId": "fenji",
                        "dataType": 2,
                        "spliceType": 1,
                        "filterType": 1,
                        "value": this.formInline.fenjiValue
                    }
                ]
            }
            this.$apiFun.getFilterRows(param).then((res) => {
                //根据后端返回数据进行data的逻辑处理
                console.log(res)
                this.total = res.data.total
                this.tableData = res.data.rows
            })
        },

        handleSizeChange(val) {
            console.log(`每页 ${val} 条`);
            this.pageSize = val
            this.getFilterRows()
        },
        handleCurrentChange(val) {
            console.log(`当前页: ${val}`);
            this.currentPage = val
            this.getFilterRows()
        },



        //模型接口
        predict(item) {
            console.log(item)
            var param = {
                "zlyxx": item.zlyxx,
                "sscs": item.sscs,
                "zycs": item.zycs2,
                "flsj": item.flsj,
                "jdtzgs": item.jdtzgs,
                "kztzgs": item.kztzgs,
                "ipc": item.ipc,
                "sqrsl": item.sqrsl,
                "fmrsl": item.fmrsl,
                "xkcs": item.xkcs,
                "zrcs": item.zrcs,
                "hgba": item.hgba,
                "qlyqsl": item.qlyqsl,
                "dlqlyqsl": item.dlqlyqsl,
                "csqlyqsl": item.csqlyqsl,
                "wxys": item.wxys,
                "sqzs": item.sqzs,
                "zllx": item.zllx,
                // "shenqingri": '2006-05-31',
                "shenqingri": item.shenqingri,
                "sqggr": item.sqggr,
                "shixiaori": item.shixiaori,
                "tzgj_dq": item.tzgj_dq,
                "sqrlx": item.sqrlx,
                "sslx": item.sslx,
                "jiangxiang": item.jiangxiang,
                "gk_gg_h": item.gk_gg_h,
                "srrlx": item.srrlx
            }
            this.$apiFun.predict(param).then((res) => {
                //根据后端返回数据进行data的逻辑处理
                console.log(res)
                this.form.fenji = res.prediction
                this.form.bzzl = res.bzzl
                this.form.hgba = res.hgba
                this.form.hjqk = res.hjqk
                this.form.qqqk = res.qqqk
                this.form.wxqk = res.wxqk
                this.form.xkqk = res.xkqk
                this.form.zrqk = res.zrqk
                this.form.zzfj = res.prediction
            })
        },

        //点击确认之后执行：新增记录
        addRow() {
            // this.dialogFormVisible = false
            if (this.form.gk_gg_h == '') {
                this.$message({
                    message: '请输入公开（公告）号',
                    type: 'warning'
                });
                return
            }
            if (this.form.zzfj == 'A') {
                this.form.fenzhi = 100
            } else if (this.form.zzfj == 'B') {
                this.form.fenzhi = 75
            } else if (this.form.zzfj == 'C') {
                this.form.fenzhi = 50
            } else if (this.form.zzfj == 'D') {
                this.form.fenzhi = 25
            } else {
                this.form.fenzhi = 0
            }
            var param = {
                "appKey": "c4d42996f1b29c98",
                "sign": "MGJjY2VmMGQwYjIzYzM3OTBjYmYyODk0ODJjOGQ0ZmY1Y2MzZTRlZDNkMmIyYzM1NTRjZDMxYTIwMzg3ODIzMw==",
                "worksheetId": "64dc89d71777cd57b6e251de",
                "controls": [
                    {
                        "controlId": "zlyxx",
                        "value": this.form.zlyxx
                    },
                    {
                        "controlId": "shenqingri",
                        "value": this.form.shenqingri
                    },
                    {
                        "controlId": "bt_zw_",
                        "value": this.form.bt_zw_
                    },
                    {
                        "controlId": "gk_gg_h",
                        "value": this.form.gk_gg_h
                    },
                    {
                        "controlId": "zhaiyao",
                        "value": this.form.zhaiyao
                    },
                    {
                        "controlId": "fenji",
                        "value": this.form.fenji
                    },
                    {
                        "controlId": "ssdw",
                        "value": this.form.ssdw
                    },
                    {
                        "controlId": "zlybk",
                        "value": this.form.zlybk
                    },
                    {
                        "controlId": "wxqk",
                        "value": this.form.wxqk
                    },
                    {
                        "controlId": "qqqk",
                        "value": this.form.qqqk
                    },
                    {
                        "controlId": "xkqk",
                        "value": this.form.xkqk
                    },
                    {
                        "controlId": "hgba",
                        "value": this.form.hgba
                    },
                    {
                        "controlId": "zrqk",
                        "value": this.form.zrqk
                    },
                    {
                        "controlId": "tzgj_dq",
                        "value": this.form.tzgj_dq
                    },
                    {
                        "controlId": "jdtzgs",
                        "value": this.form.jdtzgs
                    },
                    {
                        "controlId": "kztzgs",
                        "value": this.form.kztzgs
                    },
                    {
                        "controlId": "qlyqsl",
                        "value": this.form.qlyqsl
                    },
                    {
                        "controlId": "dlqlyqsl",
                        "value": this.form.dlqlyqsl
                    },
                    {
                        "controlId": "csqlyqsl",
                        "value": this.form.csqlyqsl
                    },
                    {
                        "controlId": "hjqk",
                        "value": this.form.hjqk
                    },
                    {
                        "controlId": "bzzl",
                        "value": this.form.bzzl
                    },
                    {
                        "controlId": "zzfj",
                        "value": this.form.zzfj
                    },
                    {
                        "controlId": "famingren",
                        "value": this.form.famingren
                    },
                    {
                        "controlId": "fenzhi",
                        "value": this.form.fenzhi
                    }
                ]
            }
            this.$apiFun.addRow(param).then((res) => {
                //根据后端返回数据进行data的逻辑处理
                console.log(res)
                this.dialogFormVisible = false
                this.getFilterRows()
            })
        },
        //重置
        resetForm(formName) {
            this.formInline.bt_zw_ = ''
            this.formInline.gk_gg_h = ''
            this.formInline.famingren = ''
            this.formInline.fenjiValue = ''
            this.getFilterRows()
        },
        //查询
        onSubmit() {
            console.log('submit!');
            this.getFilterRows()
        },
        //删除
        deleteRow(row) {
            console.log(row)
            this.$confirm('是否确认删除, 是否继续?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
            }).then(() => {

                var param = {
                    "appKey": "c4d42996f1b29c98",
                    "sign": "MGJjY2VmMGQwYjIzYzM3OTBjYmYyODk0ODJjOGQ0ZmY1Y2MzZTRlZDNkMmIyYzM1NTRjZDMxYTIwMzg3ODIzMw==",
                    "worksheetId": "64dc89d71777cd57b6e251de",
                    "rowId": row.rowid
                }
                this.$apiFun.deleteRow(param).then((res) => {
                    //根据后端返回数据进行data的逻辑处理
                    this.$message({
                        type: 'success',
                        message: '删除成功!'
                    });
                    this.getFilterRows()
                })
            }).catch(() => {
                this.$message({
                    type: 'info',
                    message: '已取消删除'
                });
            });
        },

        //查看
        handleClick(row) {
            this.rowItem = row
            this.rowVisible = true
        },

        //编辑
        editClick(row) {
            this.editFrom = row
            this.dialogEditVisible = true
        },

        //编辑提交
        editRow() {
            var param = {
                "appKey": "c4d42996f1b29c98",
                "sign": "MGJjY2VmMGQwYjIzYzM3OTBjYmYyODk0ODJjOGQ0ZmY1Y2MzZTRlZDNkMmIyYzM1NTRjZDMxYTIwMzg3ODIzMw==",
                "worksheetId": "64dc89d71777cd57b6e251de",
                "rowId": this.editFrom.rowid,
                "controls": [

                    {
                        "controlId": "fenji",
                        "value": this.editFrom.fenji
                    }
                ]
            }
            this.$apiFun.fenjiEdit(param).then((res) => {
                //根据后端返回数据进行data的逻辑处理
                console.log(res)
                this.dialogEditVisible = false
                this.getFilterRows()
            })
        }
    }
}
</script>

<style lang="scss" scoped>
.markModel {
    background-color: #fff;
    padding: 15px;
}

td {
    // padding-bottom: 50px !important;
}

.el-form-item {
    text-align: left;
}
</style>